import {
	request,
} from '@/api/request';
const apiList = [{
		// 密码登录 /api/user/login
		name: 'login',
		url: '/api/user/login'
	},
	{
		// /api/user/register
		name: 'register',
		url: '/api/user/register'
	},
	{
		// /api/user/index
		name: 'userindex',
		url: '/api/user/index',
		method:'GET',
		showlod:true
	},
	{
		// /api/user/profile
		name: 'profile',
		url: '/api/user/profile'
	},
	{
		// /api/user/mobilelogin
		name: 'mobilelogin',
		url: '/api/user/mobilelogin'
	},
	{
		// /api/user/myTeam
		name: 'myTeam',
		url: '/api/user/myTeam'
	},
	{
		// /api/user/moneyDetail
		name: 'moneyDetail',
		url: '/api/user/moneyDetail',
		method:'GET'
	},
	{
		// /api/user/myWallet
		name: 'myWallet',
		url: '/api/user/myWallet',
		method:'GET'
	},
	{
		// /api/user/salePost
		name: 'salePost',
		url: '/api/user/salePost',
	},
	{
		// /api/user/bindCard
		name: 'bindCard',
		url: '/api/user/bindCard',
	},
	{
		// /api/user/createLoan
		name: 'createLoan',
		url: '/api/user/createLoan',
	},
	{
		// /api/user/defaultAddress
		name: 'defaultAddress',
		url: '/api/user/defaultAddress',
		method:'GET'
	},
	{
		// /api/user/insertAddress
		name: 'insertAddress',
		url: '/api/user/insertAddress'
	},
	{
		// /api/user/editAddress
		name: 'editAddress',
		url: '/api/user/editAddress'
	},
	{
		// /api/user/getAddress
		name: 'getAddress',
		url: '/api/user/getAddress',
		method:'GET'
	},
	{
		// /api/user/getMyBank
		name: 'getMyBank',
		url: '/api/user/getMyBank',
		method:'GET'
	},
	{
		// /api/user/editBank
		name: 'editBank',
		url: '/api/user/editBank',
	},
	{
		// /api/index/meterAmount
		name: 'meterAmount',
		url: '/api/index/meterAmount',
		method:'GET'
	},
	{
		// /api/user/createOrder
		name: 'createOrder',
		url: '/api/user/createOrder',
	},
	{
		// /api/user/myOrder
		name: 'myOrder',
		url: '/api/user/myOrder',
		method:'GET'
	},
	{
		// /api/boss/cancelOrder
		name: 'cancelOrder',
		url: '/api/boss/cancelOrder',
		method:'GET'
	},
	{
		// /api/boss/editOrder
		name: 'editOrder',
		url: '/api/boss/editOrder',
	},
	{
		// /api/user/myDead
		name: 'myDead',
		url: '/api/user/myDead',
		method:'GET',
		showlod:true
	},
	{
		// /api/user/myDead
		name: 'getUserUrl',
		url: '/api/fa/getUserUrl',
		method:'GET',
		showlod:true
	}
]


module.exports = apiList.reduce((mode, params) => {
	mode[params.name] = (data, token) => request({
		url: params.url,
		method: params.method || 'POST',
		data,
		token,
		showlod:params.showlod
	})
	return mode
}, {})